package com.ytc.media.service;

import com.aliyuncs.exceptions.ClientException;
import com.ytc.commons.model.dto.*;
import com.ytc.commons.model.vo.MediaVo;
import com.ytc.commons.model.vo.ResourceVo;
import com.ytc.commons.model.vo.ResponseResult;
import com.ytc.commons.model.vo.VodUploadVo;
import com.ytc.media.domain.Media;
import com.baomidou.mybatisplus.extension.service.IService;

/**
 * <p>
 * 媒资信息 服务类
 * </p>
 *
 * @author jiuye145
 * @since 2023-04-04
 */
public interface MediaService extends IService<Media> {
    //获取上传凭证
    ResponseResult<VodUploadVo> creatToken(VodUploadDto vodUploadDto)  throws Exception;
    //刷新上传凭证
    ResponseResult<VodUploadVo> refreshToken(String videoId) throws Exception;
    //保存视频
    ResponseResult saveMedia(MediaDto dto)throws Exception;
    //分页查询视频列表
    ResponseResult<MediaVo> findAll(PageRequest request, MediaQueryDto dto);
    //视频预览操作
    ResponseResult<String> previewMedia(Long mediaId)throws Exception;
    //视频移除操作
    ResponseResult<Boolean> deleteMedia(Long mediaId);
    //根据id查询视频
    ResponseResult<MediaVo> findById(Long mediaId);
    //管理员审核视频
    ResponseResult auditMedia(MediaAuditDto dto);

    //用于feign接口调用获取播放url
    ResponseResult<ResourceVo> findMediaUrl(Long mediaId)throws Exception;
}
